<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>求斐波那契数列第N项的值</title>
</head>
<body>
    <script>
       function recursion(n){
           if(n<0){
               return "输入的数字不能小于0";
           } else if(n==0){
               return 0;
           } else if(n==1){
               return 1;
           } else if(n>1){
               return recursion(n-1)+recursion(n-2);
           }
       }
       document.write(recursion(10));
    </script>
    <p><a href="第四章作业.html">返回</a></p>
</body>
</html>